<html>
<head><meta charset="utf-8"><title>Hi from Robin · new members · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/index.html">new members</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html">Hi from Robin</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215879887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215879887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215879887">(Nov 06 2020 at 17:44)</a>:</h4>
<p>Hello! I'm a back-end developer at hearth. I am (was?) a huge fan of C++ for nearly a decade since I started programming, and got interest on Rust about a year ago. Since that I successfully rewrote a python codebase in Rust at work, and I loved it!<br>
I have 15 days in lockdown until my next contract, and I'd like to participate in some concrete Rust suggestion. Mentorship is very welcome.</p>



<a name="215880988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215880988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215880988">(Nov 06 2020 at 17:53)</a>:</h4>
<p>hello Robin! Are you interested in working on rustdoc perhaps? <a href="https://github.com/rust-lang/rust/issues/73754">https://github.com/rust-lang/rust/issues/73754</a> is a medium-hard issue to work on, although I could find some easier issues if you like.</p>



<a name="215881835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215881835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215881835">(Nov 06 2020 at 18:00)</a>:</h4>
<p>I definitively can take a look. However, what do I need to build to be able to work on it? My computer is 6 years old, and I don't have that much empty space. It's usually not an issue at all, but I'm not sure I can build the full rust compiler 2 times + all the tools if I need to bootstrap the Rust compiler.</p>



<a name="215882452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215882452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215882452">(Nov 06 2020 at 18:05)</a>:</h4>
<p>Basically, what command should I run to be able to build the minimum amount of stuff needed, and what command should I run to be able to reproduce the issue?</p>



<a name="215882981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215882981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215882981">(Nov 06 2020 at 18:10)</a>:</h4>
<p>I would have suggested you <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html">this page from the rustc dev guide</a> but it's focused on rustc as opposed to rustdoc</p>



<a name="215883803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215883803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215883803">(Nov 06 2020 at 18:17)</a>:</h4>
<p>Hmm if you have an old computer I'd suggest working on some dev tools instead of the rust compiler itself</p>



<a name="215883826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215883826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215883826">(Nov 06 2020 at 18:17)</a>:</h4>
<p>Clippy is pretty easy to work on and <a href="http://docs.rs">docs.rs</a> always needs help</p>



<a name="215884077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215884077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215884077">(Nov 06 2020 at 18:19)</a>:</h4>
<p>I'm thinking if you like back-end you might want to take a look at <a href="http://docs.rs">docs.rs</a> :)</p>



<a name="215884344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215884344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215884344">(Nov 06 2020 at 18:21)</a>:</h4>
<blockquote>
<p>Hmm if you have an old computer<br>
I really need a good reason to upgrade it and buy a new AMD processor. But since I don't play games anymore, I can't use that excuse anymore.</p>
</blockquote>



<a name="215884552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215884552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215884552">(Nov 06 2020 at 18:23)</a>:</h4>
<p>You can contribute to <code>rust-analyzer</code> without needing a lot of disk space for the build directory <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="215887263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215887263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215887263">(Nov 06 2020 at 18:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="255061">LeSeulArtichaut</span> <a href="#narrow/stream/122652-new-members/topic/Hi.20from.20Robin/near/215884077">said</a>:</p>
<blockquote>
<p>I'm thinking if you like back-end you might want to take a look at <a href="http://docs.rs">docs.rs</a> :)</p>
</blockquote>
<p><a href="https://github.com/rust-lang/docs.rs/issues/1168">https://github.com/rust-lang/docs.rs/issues/1168</a> might be interesting, or <a href="https://github.com/rust-lang/docs.rs/issues/1150">https://github.com/rust-lang/docs.rs/issues/1150</a> if you want something more 'systems'-y</p>



<a name="215887274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215887274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215887274">(Nov 06 2020 at 18:42)</a>:</h4>
<p>and we have lots of things in between</p>



<a name="215995826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215995826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215995826">(Nov 08 2020 at 08:25)</a>:</h4>
<p>I finally knows exactly what I want to work on. In order to have a good understanding of an unknown codebase, I would like to get the whole call graph. I searched before, and didn't found one. But since I have some free time, I could build it myself! I'm posting here, because I don't know where to find some of the information. The pipeline is relatively simple:</p>
<ul>
<li>extract the fully qualified name of all functions/methods declared in the crate.</li>
<li>create an hyperlink to the documentation of said function.</li>
<li>extract from the AST/IR/…? the fully qualified name of all called functions. Ideally also extract all <code>Fn</code>, Trait parameters and other means to inject function dependencies</li>
<li>create a graph of dependencies, export it with graphviz</li>
<li>displays the graph</li>
</ul>
<p>Where should I get the information for step 1 and step 3? I guess that rust-analyser and rustc are my best bet. I could also look at llvm IR? I'm proficient both in C++ and Rust, so even if I'd like to do this project in Rust, if it's easier to extract the information using C++ libraries it's totally ok for me.</p>



<a name="215995938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/215995938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#215995938">(Nov 08 2020 at 08:28)</a>:</h4>
<p>Note: I'm not 100% sure of the meaning of <code>callgraph</code>. What I want is the static relationship between functions: which one is calling which other one, and vice-versa.</p>



<a name="216001428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216001428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216001428">(Nov 08 2020 at 10:55)</a>:</h4>
<p>I guess you can use either RLS/<code>rustc</code>or <code>rust-analyzer</code>. The advantage of the latter is that you don't have to build the compiler (and it builds pretty quickly), but the APIs might still change and the type inference (especially trait solving) isn't very accurate yet. It has a call hierarchy feature you can take inspiration from.</p>



<a name="216001736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216001736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216001736">(Nov 08 2020 at 11:03)</a>:</h4>
<p>Perfect, thanks. I will try with rust-analyser at first.</p>



<a name="216001892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216001892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216001892">(Nov 08 2020 at 11:07)</a>:</h4>
<p>There's a <a class="stream" data-stream-id="185405" href="/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0">#t-compiler/wg-rls-2.0</a>  stream where you can ask for help.</p>



<a name="216010827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216010827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216010827">(Nov 08 2020 at 15:10)</a>:</h4>
<p>If you use rustup-toolchain-install-master you don't need to build from source</p>



<a name="216010932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216010932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216010932">(Nov 08 2020 at 15:12)</a>:</h4>
<p>you could write a <code>Visitor</code> that only looks at functions <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/visit/trait.Visitor.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/visit/trait.Visitor.html</a></p>



<a name="216010937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216010937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216010937">(Nov 08 2020 at 15:12)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/util/struct.ReplaceBodyWithLoop.html"><code>ReplaceBodyWithLoop</code></a> is an example for that</p>



<a name="216010992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216010992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216010992">(Nov 08 2020 at 15:14)</a>:</h4>
<p>although you'll have to wait until type checking to get information about callgraphs, hmm</p>



<a name="216011011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216011011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216011011">(Nov 08 2020 at 15:15)</a>:</h4>
<p>ok, you want <code>tcx.hir().krate().body_ids</code>: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.body_owners">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.body_owners</a></p>



<a name="216011054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216011054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216011054">(Nov 08 2020 at 15:16)</a>:</h4>
<p>and then you can look at each function body one at a time</p>



<a name="216011537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216011537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216011537">(Nov 08 2020 at 15:31)</a>:</h4>
<p>It would be awesome if you could submit your results for addition to the rustc dev guide!</p>



<a name="216011573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216011573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216011573">(Nov 08 2020 at 15:32)</a>:</h4>
<p>What do you mean by result? The executable I'm writing?</p>



<a name="216012479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216012479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216012479">(Nov 08 2020 at 15:54)</a>:</h4>
<p>personally I would <em>love</em> to have a call-graph for rustdoc, it would be super useful for figuring out where things break</p>



<a name="216012488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216012488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216012488">(Nov 08 2020 at 15:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="255061">LeSeulArtichaut</span> <a href="#narrow/stream/122652-new-members/topic/Hi.20from.20Robin/near/216011537">said</a>:</p>
<blockquote>
<p>It would be awesome if you could submit your results for addition to the rustc dev guide!</p>
</blockquote>
<p>I think <span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> meant the output of running your program on the compiler itself</p>



<a name="216012638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216012638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216012638">(Nov 08 2020 at 15:59)</a>:</h4>
<p>My goal is to write that tool, then to publish it (probably on <a href="http://crates.io">crates.io</a>, probably using a GPLv3 licence if it's possible with the crate I will use). And yes I can totally test it on rustc, that even a good test case to be sure that everything is working!</p>



<a name="216012687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216012687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216012687">(Nov 08 2020 at 16:00)</a>:</h4>
<p>I started a conversation <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Extract.20callgraph.20of.20a.20crate">here</a> to maybe get more visibility. I think it's better if we continue there. EDIT: moved on t-compiler/help instead of t-compiler/wg-rls-2.0</p>



<a name="216014649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/216014649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#216014649">(Nov 08 2020 at 16:47)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> Awesome!</p>



<a name="217614288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Hi%20from%20Robin/near/217614288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Hi.20from.20Robin.html#217614288">(Nov 23 2020 at 11:01)</a>:</h4>
<p>I just wanted to say somewhere that I really, really love the borrow checker. <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span>  I had a buggy data structure that had a reference to a local, and this code was touching  at least 4 functions, and 3 Data structures. And there are lifetime annotation everywhere. It took me about an hour to fix my design, instead of many, many hours within gdb if I wrote my code in C++</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>